﻿<!DOCTYPE>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	//获得本项目的地址(例如: http://localhost:8080/MyApp/)赋值给basePath变量 
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	pageContext.setAttribute("basePath", basePath);
	pageContext.setAttribute("path", path);
%>
<html>
<head>
<link rel="stylesheet" type="text/css" href="${basePath}css/style.css" />
<script type="text/javascript" src="${basePath}js/jquery-3.2.1.js"></script>
<script type="text/javascript" src="${basePath}js/jquery.form.js"></script>
<title>首页</title>
<meta content="description" name="description">
<meta content="keywords" name="keywords">
<style>
.ui-autocomplete {
	width: 488px;
	background: #fafafa !important;
	position: relative;
	z-index: 10;
	border: 2px solid #91cebe;
}

.ui-autocomplete-category {
	font-size: 16px;
	color: #999;
	width: 50px;
	position: absolute;
	z-index: 11;
	right: 0px; /*top: 6px; */
	text-align: center;
	border-top: 1px dashed #e5e5e5;
	padding: 5px 0;
}

.ui-menu-item {
	*width: 439px;
	vertical-align: middle;
	position: relative;
	margin: 0px;
	margin-right: 50px !important;
	background: #fff;
	border-right: 1px dashed #ededed;
}

.ui-menu-item a {
	display: block;
	overflow: hidden;
}
</style>
</head>
<body>
	<div id="body">
		<%@include file="../header.jsp"%>
		<!-- end #header -->
		<div id="container">

			<div class="sidebar">
				<div id="options" class="greybg">
					<dl>
						<dt>
							月薪起步[k] <em></em>
						</dt>
						<dd>
							<div>
								<span><input value="" name="salaryMin" id="salaryMin" /></span>
							</div>
						</dd>
					</dl>

					<dl>
						<dt>
							最低学历 <em></em>
						</dt>
						<dd>
							<div>
								<span><input value="" name="edu" id="edu" /></span>
							</div>
						</dd>
					</dl>
					<dl>
						<dt>
							工作地点 <em></em>
						</dt>
						<dd>
							<div>
								<span><input value="" name="workCity" id="workCity" /></span>
							</div>
						</dd>
					</dl>
				</div>

			</div>

			<div class="content">
				<div id="search_box">
					<form id="searchForm" name="searchForm"
						action="${basePath}user/getRecruitmentInformations" method="post"
						onsubmit="return getDate();">
						<ul id="searchType">
							<li class="type_selected">职位</li>
						</ul>
						<input type="text" id="search_input" name="positionDesc"
							tabindex="1" value="" placeholder="请输入岗位名称，如：Web工程师" /> <input
							type="submit" id="search_button" value="搜索" />
					</form>
				</div>



				<ul class="hot_pos reset" id="dataUl">
					<li class="odd clearfix">
						<div class="hot_pos_l">
							<div class="mb10">
								<a href="h/jobs/86989.html" title="前端开发" target="_blank">前端开发</a>
								&nbsp; <span class="c9">[北京]</span>
							</div>
							<span><em class="c7">月薪：</em>10k-20k</span> <span><em
								class="c7">经验：</em> 3-5年</span> <span><em class="c7">最低学历：
							</em>本科</span> <br /> <span><em class="c7">职位诱惑：</em>借移动医疗大势享受坐直升飞机的职场发展</span>
							<br /> <span>1天前发布</span>
						</div>
						<div class="hot_pos_r">
							<div class="apply">
								<a href="toudi.html" target="_blank">投个简历</a>
							</div>
						</div>
					</li>

				</ul>
				<div class="Pagination"></div>
			</div>

		</div>
		<!-- end #container -->
	</div>
	<!-- end #body -->


	<!--  -->
	<script>
		$(function() {
			getDate();
		});

		function getDate() {
			var salaryMin = $("#salaryMin").val();
			var edu = $("#edu").val();
			var workCity = $("#workCity").val();
			$("#searchForm")
					.ajaxSubmit(
							{
								type : 'post',
								url : '${basePath}user/getRecruitmentInformations',
								dataType : "json",
								data : {
									salaryMin : salaryMin,
									edu : edu,
									workCity : workCity
								},
								success : function(result) {
									var model = result.model;
									console.log("提交成功");
									if (model.code == 0) {
										console.log(model.msg);
										var list = model.list;
										$("#dataUl").html("");
										if (list.length == 0) {
											$("#dataUl")
													.append(
															'<div class="addnew">没有找到有效职位……<br></div>');

										}
										for (var i = 0; i < list.length; i++) {
											var tem = "";
											tem += '<li class="odd clearfix"><div class="hot_pos_l"><div class="mb10">';
											tem += '<a href="javascript:vano();" title="'+list[i].positionDesc+'" target="_blank">'
													+ list[i].positionDesc
													+ '</a>';
											tem += '&nbsp; <span class="c9">['
													+ list[i].workCity
													+ ']</span></div><span><em class="c7">月薪：';
											tem += '</em>'
													+ list[i].salaryMin
													+ 'k-'
													+ list[i].salaryMax
													+ 'k</span> <span><emclass="c7">经验：</em> '
													+ list[i].demandExpDesc
													+ '</span>';
											tem += ' <span><em class="c7">最低学历：</em>'
													+ list[i].educationalBackgroundDesc
													+ '</span> <br />';
											tem += '<span><em class="c7">职位诱惑：</em>'+ list[i].benefits+ '</span>';
											tem += '<br /> <span>'+ new Date(list[i].publishTime).toLocaleDateString()+ '</span></div><div class="hot_pos_r"><div class="apply">';
											tem += '<a href="javascript:vano();" target="_blank">投个简历</a></div></div></li>';
											$("#dataUl").append(tem);
										}
									} else {
										alert(model.msg);
										console.log(model.msg);
									}

								},
								error : function(result) {
									alert("系统异常");
								}
								
							});
			return false; // 阻止表单自动提交事件
		}
		function vano(){
			alert("hr不能进行投递简历");
		}
	</script>
</body>
</html>